package com.zhdl.network.comm.analysis;

import com.project.command.faq.analysis.ComAnalysis;
import com.project.command.faq.analysis.ComAnalysisData;
import com.project.command.faq.analysis.ComAnalysisResult;
import com.zhdl.network.comm.dto.CommDemoFrameDto;
import io.netty.buffer.ByteBuf;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zhangyy
 * @Email: zhang10092009@hotmail.com
 * @Date: 2023/12/13 10:14:53
 * @Version: v1.0
 * @Modified:
 * @Description:
 */
@Slf4j
@Service(CommDemoAnalysis.COMM_DEMON)
public class CommDemoAnalysis implements ComAnalysis<CommDemoFrameDto, ByteBuf> {
    public final static String COMM_DEMON = "comm-demo";

    @Override
    public ComAnalysisResult<CommDemoFrameDto> analysisData(ComAnalysisData<ByteBuf> data) {
        List<CommDemoFrameDto> pcbFrames = new ArrayList<>();
        if (!pcbFrames.isEmpty())
            log.debug("拼出完整数据包个数:" + pcbFrames.size());

        return new ComAnalysisResult<>(pcbFrames);
    }

    @Override
    public String getHeadAnalysis() {
        return "";
    }

    @Override
    public byte[] getAfterAnalysis(String cmdStr) {
        return new byte[0];
    }
}
